<extend name="Public/base"/>

<block name="body">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title cf">
        <h2>
             <if condition="ACTION_NAME eq 'add'">编辑技术评估报表
                <else/>
              技术评估报表详情
            </if>
           
        </h2>
    </div>
    <!-- 表单 -->
    <div class="with-padding">
       <h2>技术评估结果</h2>
     	<table class="table table-striped" style="width:1200px;margin:auto">
            <thead>
			    <tr>
			      <th>项目名称</th>
			      <th>专家名称</th>
			      <th>先进性</th>
			      <th>可行性</th>
			      <th>经济效益</th>
			      <th>社会价值</th>
			      <th>法律保护强度</th>
			      <th>优势</th>
			      <th>不足</th>
			    </tr>
			  </thead>
			  <tbody>
                <volist name="data" id="vo">
                <volist name="vo.zj" id="vv">
			    <tr>
			      <if condition="$key eq 0"><td  rowspan={$vo.cou} >{$vo.tecname}</td></if>		   
			      <td>{$vv.expert}</td>
			      <td>{$vv.advanced}</td>
			      <td>{$vv.credible}</td>
			      <td>{$vv.economy}</td>
			      <td>{$vv.society}</td>
			      <td>{$vv.law}</td>
			      <td>{$vv.adveval}</td>
			      <td>{$vv.weaeval}</td>
			    </tr>
			    </volist>
			  </volist> 

			  </tbody>
        </table>
        
        <h2>评估报表</h2>

		      <!-- <textarea id="content" name="report" class="form-control kindeditor" style="height:150px;">{$data.report}</textarea> -->
		      <div class="main-container" id="main-container">
					<div class="main-content">
						<!-- #section:basics/content.breadcrumbs -->
						
		
						<!-- /section:basics/content.breadcrumbs -->
						<div class="page-content">
							<!-- #section:settings.box -->
							
		
							<!-- /section:settings.box -->
							<div class="page-content-area">
								
		
								<div class="row">
									<div class="col-xs-12">
										<!-- PAGE CONTENT BEGINS -->
										
		
										<div class="wysiwyg-editor" id="editor1"></div>
		
										<div class="hr hr-double dotted"></div>
		
		
		
										<script type="text/javascript">
											var $path_assets = "/duijie/Public/assets";//this will be used in loading jQuery UI if needed!
										</script>
		
										<!-- PAGE CONTENT ENDS -->
									</div><!-- /.col -->
								</div><!-- /.row -->
							</div><!-- /.page-content-area -->
						</div><!-- /.page-content -->
					</div><!-- /.main-content -->			

					<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
						<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
					</a>
			 </div><!-- /.main-container -->

        				
        <div class="form-item" style="margin-top:20px">
            <input type="hidden" name="id" value="{$data.id}"/>
            <button type="submit" class="btn submit-btn ajax-post" target-form="form-horizontal">{:L("_SURE_WITH_SPACE_")}</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">{:L("_RETURN_WITH_SPACE_")}</button>
        </div>      
       
    </div>
     
     
</block>

<block name="script">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <script type="text/javascript" charset="utf-8">
    Think.setValue('type', {$data.type|default = 1});
    Think.setValue('lstates', {$data.lstates|default = 1});
        //导航高亮
        highlight_subnav('{:U('Actmanage/vipindex')}');
    </script>
    
    <link type="text/css" rel="stylesheet" href="/duijie/Public/js/ext/magnific/magnific-popup.css"/>
    <script type="text/javascript" src="/duijie/Public/js/ext/magnific/jquery.magnific-popup.min.js"></script>

    <script type="text/javascript" charset="utf-8" src="/duijie/Public/js/ext/webuploader/js/webuploader.js"></script>
    <link href="/duijie/Public/js/ext/webuploader/css/webuploader.css" type="text/css" rel="stylesheet">
     
      <link href="/duijie/Public/kindeditor/themes/kindeditor.css" type="text/css" rel="stylesheet">
     <link href="/duijie/Public/kindeditor/themes/default/default.css" type="text/css" rel="stylesheet">
   
      <script type="text/javascript" src="/duijie/Public/kindeditor/kindeditor.js"></script>
    <script>

        $(document).ready(function () {
            $('.popup-gallery').each(function () { // the containers for all your galleries
                $(this).magnificPopup({
                    delegate: 'a',
                    type: 'image',
                    tLoading: '正在载入 #%curr%...',
                    mainClass: 'mfp-img-mobile',
                    gallery: {
                        enabled: true,
                        navigateByImgClick: true,
                        preload: [0, 1] // Will preload 0 - before current, and 1 after the current image

                    },
                    image: {
                        tError: '<a href="%url%">图片 #%curr%</a> 无法被载入.',
                        titleSrc: function (item) {
                            /*           return item.el.attr('title') + '<small>by Marsel Van Oosten</small>';*/
                            return '';
                        },
                        verticalFit: true
                    }
                });
            });
                    });
        
               
 </script>
     
     <!-- 富文本框编辑 -->
     
		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="/duijie/Public/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="/duijie/Public/assets/css/font-awesome.min.css" />

		<!-- page specific plugin styles -->
		<link rel="stylesheet" href="/duijie/Public/assets/css/jquery-ui.custom.min.css" />

		<!-- text fonts -->
		<link rel="stylesheet" href="/duijie/Public/assets/css/ace-fonts.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="/duijie/Public/assets/css/ace.min.css" id="main-ace-style" />

		<!--[if lte IE 9]>
			<link rel="stylesheet" href="assets/css/ace-part2.min.css" />
		<![endif]-->
		<link rel="stylesheet" href="/duijie/Public/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="/duijie/Public/assets/css/ace-rtl.min.css" />

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->
		<script src="/duijie/Public/assets/js/ace-extra.min.js"></script>
         
         <script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>
        
        <script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="/duijie/Public/assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->
		<script src="/duijie/Public/assets/js/jquery-ui.custom.min.js"></script>
		<script src="/duijie/Public/assets/js/jquery.ui.touch-punch.min.js"></script>
		<script src="/duijie/Public/assets/js/markdown/markdown.min.js"></script>
		<script src="/duijie/Public/assets/js/markdown/bootstrap-markdown.min.js"></script>
		<script src="/duijie/Public/assets/js/jquery.hotkeys.min.js"></script>
		<script src="/duijie/Public/assets/js/bootstrap-wysiwyg.min.js"></script>
		<script src="/duijie/Public/assets/js/bootbox.min.js"></script>

		<!-- ace scripts -->
		<script src="/duijie/Public/assets/js/ace-elements.min.js"></script>
		<script src="/duijie/Public/assets/js/ace.min.js"></script>

		<!-- inline scripts related to this page -->
		<script type="text/javascript">
			jQuery(function($){
	
	function showErrorAlert (reason, detail) {
		var msg='';
		if (reason==='unsupported-file-type') { msg = "Unsupported format " +detail; }
		else {
			//console.log("error uploading file", reason, detail);
		}
		$('<div class="alert"> <button type="button" class="close" data-dismiss="alert">&times;</button>'+ 
		 '<strong>File upload error</strong> '+msg+' </div>').prependTo('#alerts');
	}

	//$('#editor1').ace_wysiwyg();//this will create the default editor will all buttons

	//but we want to change a few buttons colors for the third style
	$('#editor1').ace_wysiwyg({
		toolbar:
		[
			'font',
			null,
			'fontSize',
			null,
			{name:'bold', className:'btn-info'},
			{name:'italic', className:'btn-info'},
			{name:'strikethrough', className:'btn-info'},
			{name:'underline', className:'btn-info'},
			null,
			{name:'insertunorderedlist', className:'btn-success'},
			{name:'insertorderedlist', className:'btn-success'},
			{name:'outdent', className:'btn-purple'},
			{name:'indent', className:'btn-purple'},
			null,
			{name:'justifyleft', className:'btn-primary'},
			{name:'justifycenter', className:'btn-primary'},
			{name:'justifyright', className:'btn-primary'},
			{name:'justifyfull', className:'btn-inverse'},
			null,
			{name:'createLink', className:'btn-pink'},
			{name:'unlink', className:'btn-pink'},
			null,
			{name:'insertImage', className:'btn-success'},
			null,
			'foreColor',
			null,
			{name:'undo', className:'btn-grey'},
			{name:'redo', className:'btn-grey'}
		],
		'wysiwyg': {
			fileUploadError: showErrorAlert
		}
	}).prev().addClass('wysiwyg-style2');

	
	/**
	//make the editor have all the available height
	$(window).on('resize.editor', function() {
		var offset = $('#editor1').parent().offset();
		var winHeight =  $(this).height();
		
		$('#editor1').css({'height':winHeight - offset.top - 10, 'max-height': 'none'});
	}).triggerHandler('resize.editor');
	*/
	

	$('#editor2').css({'height':'200px'}).ace_wysiwyg({
		toolbar_place: function(toolbar) {
			return $(this).closest('.widget-box')
			       .find('.widget-header').prepend(toolbar)
				   .find('.wysiwyg-toolbar').addClass('inline');
		},
		toolbar:
		[
			'bold',
			{name:'italic' , title:'Change Title!', icon: 'ace-icon fa fa-leaf'},
			'strikethrough',
			null,
			'insertunorderedlist',
			'insertorderedlist',
			null,
			'justifyleft',
			'justifycenter',
			'justifyright'
		],
		speech_button: false
	});
	
	


	$('[data-toggle="buttons"] .btn').on('click', function(e){
		var target = $(this).find('input[type=radio]');
		var which = parseInt(target.val());
		var toolbar = $('#editor1').prev().get(0);
		if(which >= 1 && which <= 4) {
			toolbar.className = toolbar.className.replace(/wysiwyg\-style(1|2)/g , '');
			if(which == 1) $(toolbar).addClass('wysiwyg-style1');
			else if(which == 2) $(toolbar).addClass('wysiwyg-style2');
			if(which == 4) {
				$(toolbar).find('.btn-group > .btn').addClass('btn-white btn-round');
			} else $(toolbar).find('.btn-group > .btn-white').removeClass('btn-white btn-round');
		}
	});


	

	//RESIZE IMAGE
	
	//Add Image Resize Functionality to Chrome and Safari
	//webkit browsers don't have image resize functionality when content is editable
	//so let's add something using jQuery UI resizable
	//another option would be opening a dialog for user to enter dimensions.
	if ( typeof jQuery.ui !== 'undefined' && ace.vars['webkit'] ) {
		
		var lastResizableImg = null;
		function destroyResizable() {
			if(lastResizableImg == null) return;
			lastResizableImg.resizable( "destroy" );
			lastResizableImg.removeData('resizable');
			lastResizableImg = null;
		}

		var enableImageResize = function() {
			$('.wysiwyg-editor')
			.on('mousedown', function(e) {
				var target = $(e.target);
				if( e.target instanceof HTMLImageElement ) {
					if( !target.data('resizable') ) {
						target.resizable({
							aspectRatio: e.target.width / e.target.height,
						});
						target.data('resizable', true);
						
						if( lastResizableImg != null ) {
							//disable previous resizable image
							lastResizableImg.resizable( "destroy" );
							lastResizableImg.removeData('resizable');
						}
						lastResizableImg = target;
					}
				}
			})
			.on('click', function(e) {
				if( lastResizableImg != null && !(e.target instanceof HTMLImageElement) ) {
					destroyResizable();
				}
			})
			.on('keydown', function() {
				destroyResizable();
			});
	    }

		enableImageResize();

		/**
		//or we can load the jQuery UI dynamically only if needed
		if (typeof jQuery.ui !== 'undefined') enableImageResize();
		else {//load jQuery UI if not loaded
			$.getScript($path_assets+"/js/jquery-ui.custom.min.js", function(data, textStatus, jqxhr) {
				enableImageResize()
			});
		}
		*/
	}


});
		</script>

		<!-- the following scripts are used in demo only for onpage help and you don't need them -->
		<link rel="stylesheet" href="/duijie/Public/assets/css/ace.onpage-help.css" />
		<link rel="stylesheet" href="/duijie/Public/docs/assets/js/themes/sunburst.css" />

		<script type="text/javascript"> ace.vars['base'] = '..'; </script>
		<script src="/duijie/Public/assets/js/ace/elements.onpage-help.js"></script>
		<script src="/duijie/Public/assets/js/ace/ace.onpage-help.js"></script>
		<script src="/duijie/Public/docs/assets/js/rainbow.js"></script>
		<script src="/duijie/Public/docs/assets/js/language/generic.js"></script>
		<script src="/duijie/Public/docs/assets/js/language/html.js"></script>
		<script src="/duijie/Public/docs/assets/js/language/css.js"></script>
		<script src="/duijie/Public/docs/assets/js/language/javascript.js"></script>
		
</block>
